import { httpForm } from "@/request/http";

//币币交易-买入-开仓页面参数
const tradeBuyToken = (params) => {
    return httpForm({
        url: "/api/exchangeapplyorder!openview.action",
        method: "post",
        isLoading: false
    }, params)
};

//币币交易-卖出-开仓页面参数
const tradeSellToken = (params) => {
    return httpForm({
        url: "/api/exchangeapplyorder!closeview.action",
        method: "post",
        isLoading: false
    }, params)
};


//币币交易-买入
const tradeBuy = (params) => {
    return httpForm({
        url: "/api/exchangeapplyorder!open.action",
        method: "post",
        isLoading: false
    }, params)
};

//币币交易-卖出
const tradeSell= (params) => {
    return httpForm({
        url: "/api/exchangeapplyorder!close.action",
        method: "post",
        isLoading: false
    }, params)
};

//币币交易-交易记录
const tradeRecord = (params) => {
    return httpForm({
        url: "/api/exchangeapplyorder!list.action",
        method: "post",
        isLoading: false
    }, params)
};

//币币交易-撤单
const tradeCancel = (params) => {
    return httpForm({
        url: "/api/exchangeapplyorder!cancel.action",
        method: "post",
        isLoading: true
    }, params)
};

//币币交易-订单详情
const tradeDetail= (params) => {
    return httpForm({
        url: "/api/exchangeapplyorder!get.action",
        method: "post",
        isLoading: true
    }, params)
};


//钱包账户资产（币对）
const getPairs = (params) => {
    return httpForm({
        url: "/api/wallet!getPairs.action",
        method: "post",
        isLoading: false
    }, params)
};

const apiList = {
    tradeBuyToken, tradeSellToken, tradeBuy, tradeSell, tradeRecord, tradeCancel, tradeDetail, getPairs
}

export default apiList
